package org.vectrics.skill.struts;

import org.apache.log4j.Logger;
import org.vectrics.common.html.Form;
import org.vectrics.recruiter.RecruitServiceLocator;
import org.vectrics.skill.UserEvaluation;
import org.vectrics.user.User;

public abstract class UserSkillEntryTag extends EnterDetailSkillsTagAbstract {

	private static final long serialVersionUID = 8910650722784706302L;

	private String evaluationId = null;
	
	private User user = null;
	private transient static Logger log = Logger.getLogger(UserSkillEntryTag.class);
	

	protected void addHiddenInputs(Form form) {
		try {
			UserEvaluation eval = RecruitServiceLocator.getSkillProvider().findEvaluationById(
					new Long(this.getEvaluationId()));
			
			form.addHidden("userId", eval.getPerson().getId().toString());
			form.addHidden("evaluationId", this.getEvaluationId());
		}
		catch (Exception ex) {
			log.error("Exception in addHiddenInputs()", ex);
		}
	}
	
	

	
	protected String getOwnerObjectId() {
		return(getEvaluationId());
	}

	protected int getWidth() {
		return 500;
	}

	protected boolean alwaysShowLevelEntry() {
		return(false);
	}
	
	protected boolean getShowViewChildren() {
		return false;
	}

	protected boolean getShowYesNo() {
		return true;
	}

	protected boolean getShowYears() {
		return true;
	}

	protected boolean getShowChildren() {
		return false;
	}

	protected boolean getShowRating() {
		return true;
	}

	/**
	 * @return Returns the id.
	 */
	public String getEvaluationId() {
		return evaluationId;
	}

	/**
	 * @param id The id to set.
	 */
	public void setEvaluationId(String id) {
		this.evaluationId = id;
	}

}
